using System.Collections;
using System.Collections.Generic;
using UnityEngine;

public class BuilderManager : MonoBehaviour
{
    private List<GameObject> _enemy_list;
    public static BuilderManager Instance;

    public GameObject low;
    public GameObject mid;
    public GameObject high;
    public GameObject bullet;

    void Awake()
    {
        if(Instance != null)
        {

        }
        Instance = this;

        _enemy_list = new List<GameObject>();
    }
    // Start is called before the first frame update
    void Start()
    {
        
    }

    // Update is called once per frame
    void Update()
    {
        
    }

    public GameObject GetCurrentBuild()
    {
        return low;
    }

    public void AddEnemy(GameObject enemy)
    {
        _enemy_list.Add(enemy);
    }

    public void RemoveEnemy(GameObject enemy)
    {
        _enemy_list.Remove(enemy);
    }

    public void CheckAnemy(System.Func<GameObject,bool> OnFindEnemy)
    {
       
        foreach(var enemy in _enemy_list)
        {
            if(OnFindEnemy(enemy))
            {
                break;
            }
        }
    }
}
